<%@ page import="java.util.Arrays" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2025/7/15
  Time: 14:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h3>3-4.jsp</h3>
<!--容器操作-->
<%
    // 存放
    request.setAttribute("A", 23);
    request.setAttribute("B", new Object());
    request.setAttribute("C", Arrays.asList("aa", "bb", "cc"));
    request.setAttribute("D", 23);
    // 覆盖
    request.setAttribute("B", "abc");
%>
<%
    // 删除
    request.removeAttribute("A");
%>
<%
    // 获取
    Object a = request.getAttribute("A");
    Object b = request.getAttribute("B");
    Object c = request.getAttribute("C");
    Object d = request.getAttribute("D");
    out.print(a + "," + b + "," + c + "," + d);
%>
<%
    // 页面跳转  转发
    request.getRequestDispatcher("3-5.jsp").forward(request,response);
%>
</body>
</html>
